<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Demo06</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.0.2/vue.global.js"></script>
  </head>

  <body>
    <div id="app"></div>
  </body>
  <script>
    const app = Vue.createApp({
      // 父组件
      template: ` <h2>JSPang.com</h2>  <Hello  msg="jspang"/>`,
      
    });
    //注册全局子组件
    app.component("Hello", {
      //   props: ["msg"],
      template: `
      <h3 v-bind="$attrs">Hello World-1</h3>
        <h3>Hello World</h3>
        <h3>Hello World</h3>
      `,
      mounted() {
        console.log(this.$attrs.msg);
      },
    });
    const vm = app.mount("#app");
  </script>
</html>
